<div class="col-right sidebar col-xs-12 col-sm-3">
	<div class="block block-layered-nav">
		<div class="block-title">
			<strong>
				<span>
					Shop By
				</span>
			</strong>
		</div>
        <?php
            if(count($model)){
        ?>
		<div class="block-content">
			<p class="block-subtitle">
				Shopping Options
			</p>
			<dl id="narrow-by-list">
				<dt>
					Khoảng giá
				</dt>
				<dd>
                    <?php 
                        $params=$_SERVER['REQUEST_URI']; 
                        $params=str_replace( '&range=1', '',$params); 
                        $params=str_replace( '&range=2', '',$params);
                        $params=str_replace( '&range=3', '',$params);
                        $params=str_replace( '&range=4', '',$params);
                        $params=str_replace( '&range=5', '',$params);
                    ?>
					<ol>
						<li>
							<a href="<?php echo $params;?>&range=1"><span class="price"></span> < <span class="price">1.000.000</span></a>
						</li>
                        <li>
							<a href="<?php echo $params;?>&range=2"><span class="price">1.000.000</span> - <span class="price">3.000.000</span></a>
						</li>
                        <li>
							<a href="<?php echo $params;?>&range=3"><span class="price">3.000.000</span> - <span class="price">5.000.000</span></a>
						</li>
                        <li>
							<a href="<?php echo $params;?>&range=4"><span class="price">5.000.000</span> - <span class="price">10.000.000</span></a>
						</li>
                        <li>
							<a href="<?php echo $params;?>&range=5"><span class="price"></span> > <span class="price">10.000.000</span></a>
						</li>
					</ol>
				</dd>
				<dt>
					Thương hiệu
				</dt>
				<dd>
                    <ol>
                    <?php
                        
                        //filter brand_id
                        for ($i=0;$i<count($model);$i++) {
                            $brand_ids[]=$model[$i]['brand_id'];
                        }
                        $brand_ids=array_count_values($brand_ids);
                        
                        //get current string param
                        $params=$_SERVER['REQUEST_URI']; 
                        foreach ($brand_ids as $key=>$value) {
                            //remove current param in url
                            $params=str_replace( '&brand_id='.$key, '',$params);
                    ?>
						<li>
							<a href="<?php echo $params; ?>&brand_id=<?php echo $key; ?>"><?php echo Brand::model()->getBrandName($key); ?></a> (<?php echo $value;?>)
						</li>
                        <?php
                        	}
                        ?>
					</ol>
				</dd>
			</dl>
			<script type="text/javascript">
				decorateDataList('narrow-by-list')
			</script>
		</div>
        <?php
        	}
        ?>
	</div>
	<div class="block block-cart">
		<div class="block-title">
			<strong>
				<span>
					Giỏ hàng
				</span>
			</strong>
		</div>
		<div class="block-content">
			<p class="empty">
				Không có sản phẩm nào trong giỏ.
			</p>
		</div>
	</div>
	<div class="block block-list block-compare">
		<div class="block-title">
			<strong>
				<span>
					So sánh
				</span>
			</strong>
		</div>
		<div class="block-content">
			<p class="empty">
				Bạn chưa chọn sản phẩm để so sánh.
			</p>
		</div>
	</div>
	<div class="block block-tags">
		<div class="block-title">
			<strong>
				<span>
					Tags
				</span>
			</strong>
		</div>
		<div class="block-content">
			<ul class="tags-list">
				<li>
					<a href="/product/list/tagId/8/" style="font-size:121.66666666667%;">Media</a>
				</li>
			</ul>
			<div class="actions">
				<a href="/tag/list/">Tất cả</a>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		//<![CDATA[
		function validatePollAnswerIsSelected() {
			var options = $$('input.poll_vote');
			for (i in options) {
				if (options[i].checked == true) {
					return true;
				}
			}
			return false;
		}
		//]]>
	</script>
	<div class="block block-poll">
		<div class="block-title">
			<strong>
				<span>
					Khảo sát
				</span>
			</strong>
		</div>
		<form id="pollForm" action="#/poll/vote/add/poll_id/1/" method="post" onsubmit="return validatePollAnswerIsSelected();">
			<div class="block-content">
				<p class="block-subtitle">
					What is the main reason for you to purchase products online?
				</p>
				<ul id="poll-answers">
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_1" value="1" />
						<span class="label">
							<label for="vote_1">
								More convenient shipping and delivery
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_2" value="2" />
						<span class="label">
							<label for="vote_2">
								Lower price
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_3" value="3" />
						<span class="label">
							<label for="vote_3">
								Bigger choice
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_4" value="4" />
						<span class="label">
							<label for="vote_4">
								Centralized product search procedure (without having to leave your home)
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_5" value="5" />
						<span class="label">
							<label for="vote_5">
								Payments security
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_6" value="6" />
						<span class="label">
							<label for="vote_6">
								30-day Money Back Guarantee
							</label>
						</span>
					</li>
					<li>
						<input type="radio" name="vote" class="radio poll_vote" id="vote_7" value="7" />
						<span class="label">
							<label for="vote_7">
								Other.
							</label>
						</span>
					</li>
				</ul>
				<script type="text/javascript">
				    decorateList('poll-answers');
				</script>
				<div class="actions">
					<button type="submit" title="Vote" class="button">
						<span>
							<span>
								Vote
							</span>
						</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>